home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / asm32.zip / E32.ZIP / MESSAGES.ASM < prev    next >
Assembly Source File  |  1996-08-26  |  2KB  |  104 lines

  1. ; MESSAGES.ASM for E32 - Copyright (C) 1994 - 1996 Douglas Herr
  2. ;  all rights reserved
  3.  
  4. include    model.inc
  5.  
  6.  
  7. ; WORKING
  8. ;
  9. ;  prints 'Working' message at bottom of screen
  10.  
  11. public    working
  12. extrn    tprintce:near
  13.  
  14. include    dataseg.inc
  15. extrn    warning:byte, dirty_bits:byte, rows:byte
  16. public    file_read_error
  17. file_read_error    db "can't read file",0
  18.  
  19. w        db ' Working',0
  20. err_msg        db ' ERROR: ',0
  21. err_msg_len    equ    $-err_msg
  22.  
  23. @curseg    ends
  24.  
  25.  
  26. include    codeseg.inc
  27. working    proc    near
  28.     pushfd
  29.     pushad
  30.     lea    esi,w
  31.     mov    dh,rows
  32.     inc    dh
  33.     xor    dl,dl
  34.     mov    ah,warning
  35.     call    tprintce
  36.     or    dirty_bits,00010000b    ; re-do prompt line
  37.     popad
  38.     popfd
  39.     ret
  40. working    endp
  41.  
  42. @curseg    ends
  43.  
  44.  
  45. ; YESNO_MESSAGE
  46. ;
  47. ;  This subroutine displays a message and asks for a Y/N response
  48. ;
  49. ;  call with [ESI] -> message, AH = color
  50. ;  Returns AL = key pressed
  51.  
  52. public    yesno_message
  53. extrn    yesno:near
  54. extrn    ucursoron:near
  55.  
  56. include    codeseg.inc
  57. yesno_message    proc    near
  58.     mov    dh,rows
  59.     inc    dh
  60.     xor    dl,dl
  61.     call    tprintce
  62.     mov    dl,cl
  63.     call    ucursoron
  64.     jmp    yesno
  65.  
  66. yesno_message    endp
  67.  
  68. @curseg    ends
  69.  
  70.  
  71. ; ERROR
  72. ;
  73. ;  print error message and wait for keystroke
  74. ;  call with EDX pointing to error message
  75.  
  76. public    error
  77. extrn    clearkey:near, getkey:near
  78.  
  79. include    codeseg.inc
  80. error    proc    near
  81.     pushfd
  82.     pushad
  83.     or    dirty_bits,00010000b    ; refresh prompt line
  84.     call    clearkey        ; clear keyboard buffer
  85.     push    edx            ; save pointer to error message
  86.     lea    esi,err_msg
  87.     mov    dh,rows
  88.     inc    dh            ; last row of screen
  89.     xor    dl,dl
  90.     mov    ah,warning
  91.     call    tprintce        ; print ' ERROR: '
  92.     mov    dl,err_msg_len-1
  93.     pop    esi            ; restore pointer to error message
  94.     call    tprintce        ; print message
  95.     call    getkey
  96.     popad
  97.     popfd
  98.     stc
  99.     ret
  100. error    endp
  101.  
  102. @curseg    ends
  103.     end
  104.